﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Web_Pages_UserControls_ReadMessage : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
   
    {         
        ReadMessage();
        
    }
    public void ReadMessage()
    {
        UsersBLL userBLL = new UsersBLL();
        String tenTaiKhoan = "admin";
        Users user = userBLL.GetIUsers.GetUserByUsername(tenTaiKhoan);

        

        List<Messages> message = userBLL.GetIMessages.GetMessagessOfUser(user);

        for (int i = 0; i < message.Count; i++)
        {

            String []  dong = new String [message.Count];
            //Label l1 = new Label();
            Label[] L = new Label[message.Count];
            Table t = new Table();
            L[i] = new Label();
          
          

            dong[i] = message[i].Contents.ToString();

            L[i].Text = dong[i];



            
        }
          //txtTrangthai.Text = "dang xu ly";
    }
    void CreateControl()
    {

    }

}